package com.iss.demo.controller;

import com.iss.demo.entity.UserType;
import com.iss.demo.model.MyResponseData;
import com.iss.demo.service.UserTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("usertype/")
public class UserTypeController {
    @Autowired
    private UserTypeService service;

    @RequestMapping("selectAll")
    public MyResponseData selectAll(){
        List<UserType> list = service.selectAll();
        MyResponseData responseData = new MyResponseData();
        responseData.setStatus("success");
        responseData.setErrorCode(0);
        responseData.setObjectList(list);
        return  responseData;
    }
}
